﻿using System.Collections.Generic;

namespace DataAccess
{
    public interface IDataAccess<T>
    {
        /// <summary>
        /// Querys objects from database by stored procedure.
        /// </summary>
        /// <param name="procStr">stored procedure name</param>
        /// <param name="dbParams">db parameters</param>
        /// <returns>query objects</returns>
        List<T> QueryEntitys(string procStr, DbParam[] dbParams);

        /// <summary>
        /// Querys object from database by stored procedure.
        /// </summary>
        /// <param name="procStr">stored procedure name</param>
        /// <param name="dbParams">db parameters</param>
        /// <returns>query objects</returns>
        T FindEntity(string procStr, DbParam[] dbParams);

        /// <summary>
        /// Executes stored procedure without return object.
        /// </summary>
        /// <param name="procStr">stored procedure name</param>
        /// <param name="dbParams">db parameters</param>
        void ExecProc(string procStr, DbParam[] dbParams);
    }
}
